package com.sainthigh.ip;

import com.sainthigh.androiddemos.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

public class IPActivity extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.activity_iputils);
		initView();
	}

	private void initView() {
		this.findViewById(R.id.iputils_getLocalAddress).setOnClickListener(this);;
	}

	@Override
	public void onClick(View v) {
		switch(v.getId()) {
		case R.id.iputils_getLocalAddress:
			String localIpAddress = IPUtils.getLocalIpAddress();
			Toast.makeText(this, ""+localIpAddress, Toast.LENGTH_SHORT).show();
			break;
		}
	}
	
	
}
